package com.liu.mq.produce.produce;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.jms.Destination;
import javax.jms.Topic;

@Service
public class Topic_Produce {

    @Autowired
    private JmsMessagingTemplate template;
    @Autowired
    private Topic topic;

    @Scheduled(fixedDelay = 3000)
    public void send() {
        template.convertAndSend(topic, "生产者生产信息");
    }
}
